<template>
	<div>
	<el-table :data="tableData2" style="width: 100%" :row-class-name="tableRowClassName">
		<el-table-column prop="name" label="姓名" width="180"></el-table-column>
		<el-table-column prop="pwd" label="密码" width="180"></el-table-column>
		<el-table-column prop="sex" label="性别"></el-table-column>
	</el-table>
	<el-pagination
	  small
	  layout="prev, pager, next"
	  :total="total"
	  :page-size="pageSize"
	  @current-change="">
	</el-pagination>
	</div>
</template>

<style>
.el-table .warning-row {
	background: oldlace;
}

.el-table .success-row {
	background: #f0f9eb;
}
</style>
<script>
export default {
	created() {
		this.getPage();
	},
	methods: {
		getPage:function(){
			var _this=this;
			_this.$ajax.get('http://1319.cc/aa', {
			    params: {}
			  })
			  .then(function (response) {
			    console.log(response.data.data.data);
				_this.tableData2=response.data.data.data
			  })
			  .catch(function (error) {
			    console.log(error);
			  });
		},
		tableRowClassName({ row, rowIndex }) {
			if (rowIndex === 1) {
				return 'warning-row';
			} else if (rowIndex === 3) {
				return 'success-row';
			}
			return '';
		}
	},
	data() {
		return {
			tableData2: [],
			total:12,
			pageSize:3
		};
	}
};
</script>
